package com.best.oasis.settlement.dao.security;

import java.util.List;

import com.best.oasis.settlement.common.entity.security.Role;
import com.best.oasis.settlement.common.entity.security.RoleGroupMapping;
import com.best.oasis.settlement.common.so.security.RoleSO;
import com.best.oasis.settlement.dao.base.BaseDao;

/**
 * Role Data Access Object (DAO) interface.
 */
public interface RoleDao extends BaseDao<Role, Long> {
    /**
     * Gets role information based on rolename
     * 
     * @param rolename the rolename
     * @return populated role object
     */
    Role getRoleByName(String rolename);

    /**
     * Removes a role from the database by name
     * 
     * @param rolename the role's rolename
     */
    void removeRole(String rolename);

    /**
     * 根据parentId获取所有节点
     * 
     * @param parentId
     * @return
     */
    public List<Role> getAllChildren(Long parentId);

    /**
     * 获取ROOT节点
     * 
     * @return
     */
    public Role getRootRole();

    public List<Role> getAll(RoleSO so);

    public boolean checkByRole(Long roleId);

    public List<Role> getRolesByUserID(Long userID);

    public List<Role> getRolesByRoleGroupId(Long id);
    
    
    public void removeRoleGroupRole(Long groupid);

    public void createRoleGroupRole(RoleGroupMapping object);
}
